/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.flealancemarket.service.commands.impl;

import com.googlecode.flealancemarket.metamodel.User;
import com.googlecode.flealancemarket.service.commands.CountUnreadMessages;
import com.googlecode.flealancemarket.service.facades.MessagesFacade;

/**
 *
 * @author vanja
 */
public class CountUnreadMessagesImpl implements CountUnreadMessages {

    private MessagesFacade facade;
    private User user;

    public void setUser(User user) {
        this.user = user;
    }

    public int execute() {
        return facade.countUnreadMessages(user);
    }

    public MessagesFacade getFacade() {
        return facade;
    }

    public void setFacade(MessagesFacade facade) {
        this.facade = facade;
    }
}
